package com.example.service.Impl;


import com.example.Mapper.CommentMapper;
import com.example.service.CommentService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;


@Service
@Transactional
public class CommentServiceImpl implements CommentService {

    @Autowired
    private CommentMapper commentDao;


   /* @Override
    public ServerResponse<String> add(Comment comment) {
        int resultCount = commentDao.insert(comment);
        
        if(resultCount != 1){
            return ServerResponse.createByErrorMsg("评论失败");
        }
        return ServerResponse.createBySuccessMsg("评论成功");
    }

    @Override
    public ServerResponse<String> deleteById(Integer id) {
        int resultCount = commentDao.deleteById(id);
        if(resultCount != 1){
            return ServerResponse.createByErrorMsg("删除评论失败");
        }
        return ServerResponse.createBySuccessMsg("删除评论成功");
    }

    @Override
    public ServerResponse<String> checkComment(Integer id) {
        boolean resultCount = commentDao.checkComment(id);
        if(resultCount == false){
            return ServerResponse.createByErrorMsg("审核评论失败");
        }
        return ServerResponse.createBySuccessMsg("审核评论成功");
    }*/
}
